<?php
/*---------------------------------------------------------------------------
 小微OA系统 - 让工作更轻松快乐

 Copyright (c) 2013 http://www.smeoa.com All rights reserved.

 Author:  jinzhu.yin<smeoa@qq.com>

 Support: https://git.oschina.net/smeoa/xiaowei
 -------------------------------------------------------------------------*/

use sef\model;

class  crm_contact_model extends base_model {
	// 自动验证设置
	protected $_validate = array( array('name', 'require', '文件名必须', 1), array('content', 'require', '内容必须'), );
	protected $filter_config = array('skip' => 'acbc,abcd,defb', 'filter_abc' => 'name,sdfed,bcde,asdgt');
	
	function get_contact($return_data = false) {		
		$this -> select('crm_contact.*,crm_company.name company_name');
		$this -> from('crm_contact');
		$this -> left('crm_company', 'crm_contact.company_id=crm_company.id');
		if ($return_data) {
			return $this -> get_list();
		} else {
			return $this;
		}
	}

}
?>